define(["jquery"],function($){
	var tpl = {};

	tpl.init = function(){
		var html = "";
		html += info();
		return html;
	};
	tpl.questList = function(){
		var html = "";
		html += questList();
		return html;
	};
	tpl.answerList = function(){
		var html = "";
		html += answerList();
		return html;
	};
	tpl.report = function(){
		var html = "";
		html += report();
		return html;
	};
		var info = function(){
		return 	'<script id="mabcDetailInfo_tpl" type="html/text">'+
				'	<div class="row panel-heading">'+
				'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">科研编号：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.hisNo||"暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">填表日期：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.createTime||"暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子姓名：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.userName|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
				'    	</div>'+
				'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">出生日期：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.birthday || "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		' 	</div>'+
				'	<div class="row panel-heading">'+
				'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子所在学校：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.school|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
		  		'      <div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">孩子所在年级：</div>'+
				'          			<div class="col-sm-7 col-md-7 class">{{data.class || "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
				'    	</div>'+
				'		{{if data.motherName}}' +
				'      	<div class="col-sm-3 col-md-3">'+
		  		'       	<div class="">'+
				'       		<div class="row">'+
				'          			<div class="col-sm-5 col-md-5 tx-r">妈妈姓名：</div>'+
				'          			<div class="col-sm-7 col-md-7">{{data.motherName|| "暂未填写"}}</div>'+
				'          		</div>'+
				'       	</div>'+
		  		'    	</div>'+
				' 		{{/if}}'+
				'		{{if data.createName}}' +  
		  		'      		<div class="col-sm-3 col-md-3">'+
		  		'       		<div class="">'+
				'       			<div class="row">'+
				'          				<div class="col-sm-5 col-md-5 tx-r">填表人：</div>'+
				'          				<div class="col-sm-7 col-md-7">{{data.createName|| "暂未填写"}}</div>'+
				'          			</div>'+
				'       		</div>'+
				'    		</div>'+
				'		{{/if}}' +
		  		' 	</div>'+
				'</script>';
	};
	var report = function(){
		return 	'<script id="mabcReport-tpl" type="html/text">'+
				'	<div class="row panel-heading">'+
					'	<div class="reportBaseInfo uhide" style="padding:1em 0;text-align: center;position: relative;">'+
			            '	<span class="solid_l"></span>'+
			            '	<span class="solid_name">基本信息</span>'+
			            '	<div style="padding:1rem 0 0 2rem;text-align:left;"><span style="display:inline-block;width:25%">姓名：{{data.userName}}</span><span style="display:inline-block;width:25%">性别：{{data.gender}}</span><span style="display:inline-block;width:25%">年龄：{{data.age}}</span>'+ '	</div>'+
			        '	</div>'+
					'	<div style="padding:1em 0;text-align: center;position: relative;">'+
			            '	<span class="solid_l"></span>'+
			            '	<span class="solid_name">困难总分</span>'+
			            '	<div class="circle animated bounceIn">'+
			                '	<div id="maxScore" ></div>'+
			                '	<div class="color2 result">评分结果</div>'+
			            '	</div>'+
			            '	<div class="tx-c color2" id="diffTotalTip" style="padding-top:1em;font-size:1.2em;">您的孩子心理发育情况正常</div>'+
			        '	</div>'+
			        '	<span class="dash_1"></span>'+  
			         '	<div style="padding:1em 0;position: relative;">'+
			            '	<span class="solid_l"></span>'+
			            '	<span class="solid_name">维度评分</span>'+
			            '	<div class="bb-report" id="bb-report"></div>'+
			        '	</div>'+
			         '	<div style="padding:1em 0;position: relative;">'+
			            '	<span class="solid_l"></span>'+
			            '	<span class="solid_name">健康指导</span><span class="saveGuide" id="saveGuide">保存</span>'+
			            '	<div class="uhide textarea" id="guideDiv">{{data.guideContent||"暂无指导"}}</div>'+
			            '	<textarea id="guide"  class="docGuid" rows="3" guideId="{{data.guideId}}">{{data.guideContent||"暂无指导"}}</textarea>'+
			        '	</div>'+
				'	</div>'+
				'</script>';
	}
	var answerList = function(){
		return 	'<script id="answerList-tpl" type="html/text">'+
			'{{each data as value i}}'+
			'	<div class="row baby-done">'+
			'		<div class="">{{value.name}}'+
			
			'{{if value.type == "listAndText"}}'+
					'{{each value.list as answer j}}'+
					'		<font class="answerName">{{answer.name}}:<span class="underline">{{answer.value}}</span>；</font>'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "unFixmultiText"}}'+
					'{{each value.list as list j}}'+
						'<div class="">'+
						'{{each list as answer k}}'+
						'		<font class="answerName">{{answer.name}}:<span class="underline">{{answer.value}}</span>；</font>'+
						'{{/each}}'+
						'		</div>'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "timeText"}}'+
					'		<span class="answerName">{{value.value}}</span>'+
			'{{/if}}'+
			'{{if value.type == "Radio" || !value.type }}'+
			'		<span class="">{{ value }}</span>'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
						'		<span class="answerName">{{quest.name}}</span>'+
						'{{/if}}'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "checkboxAndText"}}'+
			'		<span class="">{{ value }}</span>'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
						'		<span class="answerName">{{quest.name.replace(/_/g, ".")}}'+
									'{{if quest.relations&&quest.relations[0]}}' + 
										'：{{ quest.relations[0].value }}' + 
									'{{/if}}' + 
						'		</span>'+
						'{{/if}}'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "checkbox"}}'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
						'		<span class="answerName">{{quest.name}}；</span>'+
						'{{/if}}'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "mutilListRadio"}}'+
			'		<span class="">{{ value }}</span>'+
					'{{each value.list as quest j}}'+
							'<div class="answerName">{{quest.name}}：'+
							'{{each quest.childList as child k}}'+
								'<span class="answerName">{{child.name}}：</span>'+
								'{{each child.answer as answer m}}'+
									'{{if answer.checked == true}}'+
									'		<span class="answerName underline">{{answer.name}}</span>；'+
									'{{/if}}'+
								'{{/each}}'+
							'{{/each}}'+
							'</div>'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "mutilListText"}}'+
			'		<span class="">{{ value }}</span>'+
					'{{each value.list as quest j}}'+
							'<div class="answerName">{{quest.name}}：'+
							'{{each quest.childList as child k}}'+
								'<span class="answerName"><span style="min-width:60px">{{child.name}}：</span></span>'+
								'		<span class="answerName underline">{{child.value}}</span> ；'+
							'{{/each}}'+
							'</div>'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "RadioAndRadio"}}'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
							'<span class="answerName">{{quest.name}}：</span>'+
							'{{if quest.relations != "undefined"}}'+
								'{{each quest.relations as relation k}}'+
									'{{if relation.checked == true}}'+
									'		<span class="answerName">{{relation.relationsName}}</span>'+
									'{{/if}}'+
								'{{/each}}'+
							'{{/if}}'+
						'{{/if}}'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "checkboxAndRadio"}}'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
							'<span class="answerName">{{quest.name}}:</span>'+
							'{{if quest.relations != "undefined"}}'+
								'{{each quest.relations as relation k}}'+
									'{{if relation.checked == true}}'+
									'		<span class="answerName">{{relation.relationName}};</span>'+
									'{{/if}}'+
								'{{/each}}'+
							'{{/if}}'+
						'{{/if}}'+
					'{{/each}}'+
					'{{if value.ischecked == true}}'+
						'		<span class="answerName">无</span>'+
					'{{/if}}'+
			'{{/if}}'+
			
			'{{if value.type == "RadioAndText"}}'+
					'{{each value.answer as quest j}}'+
						'{{if quest.checked == true}}'+
							'<span class="answerName">{{quest.name}}</span>'+
							'{{if quest.relations != "undefined"}}'+
								'{{each quest.relations as relation k}}'+
								'		<div class="answerName">{{relation.relationName}}：<span class="underline">{{relation.value}}</span></div>'+
								'{{/each}}'+
							'{{/if}}'+
						'{{/if}}'+
					'{{/each}}'+
			'{{/if}}'+
			'{{if value.type == "Text"}}'+
					'\t<span class="answerName underline">{{value.value}}</span>'+
			'{{/if}}'+
				'{{if value.type == "listText"}}'+
					'<p>'+
					'{{each value.list as quest j}}'+
						'<div class="answerName"><span style="min-width:80px;display:inline-block;text-align: right;">{{quest.name}}：</span><span style="min-width:40px;text-align:center;display:inline-block;" class="underline">{{quest.value}}</span>；</div>'+
					'{{/each}}'+
					'</p>'+
			'{{/if}}'+
			
					'	</div></div>'+
			'{{/each}}'+
			
			'</script>';
	}
	var questList = function(){
		return 	'<script id="mabcQuestListInfo-tpl" type="html/text">'+
			'{{each data.answerResult as value i}}'+
			'	<div class="row baby-done {{if i == 0}}active{{/if}}">'+
			'		<div class="ellipsis-1 mabcModel " answerId="{{i}}">{{value.name}}</div>'+
			'	</div>'+
			'{{/each}}'+
			'{{if data.score}}'+
			'	<div class="row baby-done" style="text-align:center;">'+
			'		<div class="ellipsis-1 mabcModel" answerId="-1">评估报告</div>'+
			'	</div>'+
			'{{/if}}'+
			'</script>';
	}
	return tpl;
});